#!/usr/bin/env python
# -*- coding: utf-8 -*-


# GroupID-SystemKey
class SGList(object):
    def __init__(self):
        self.sg = []

    def add(self, systemkey=0, groupid=0):
        self.sg.append((systemkey, groupid))

    def unique(self):
        self.sg = list(set(self.sg))


class MetaDataD040(object):
    def __init__(self, name=None,
                 fieldGroupId=None,
                 compoundId=None,
                 description=None,
                 tags=None,
                 attributes=None,
                 **kwargs):
        self.name = name
        self.fieldGroupId = fieldGroupId
        self.compoundId = compoundId if compoundId else {}
        self.description = description if description else ''
        self.tags = tags if tags else []
        self.attributes = attributes if attributes else []

    def add_tag(self, tag=''):
        self.tags.append(tag)

    def add_compound(self, key, value):
        self.compoundId.update({key: value})
